﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace FwProject.Migrations.FwProjectAppShopDb
{
    public partial class Update_ShopProductSku_To_appshop : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "SpaceValueName",
                table: "ShopProductSku",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ShopName",
                table: "shop_order_details",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "SkuName",
                table: "shop_order_details",
                nullable: true);

            migrationBuilder.AddColumn<byte>(
                name: "DeliveryStatus",
                table: "shop_order",
                nullable: false,
                defaultValue: (byte)0);

            migrationBuilder.CreateTable(
                name: "common_region",
                columns: table => new
                {
                    Id = table.Column<string>(maxLength: 20, nullable: false),
                    ParentId = table.Column<string>(maxLength: 20, nullable: true),
                    Name = table.Column<string>(maxLength: 256, nullable: false),
                    Spell = table.Column<string>(maxLength: 100, nullable: true),
                    Initial = table.Column<string>(maxLength: 30, nullable: true),
                    Code = table.Column<string>(maxLength: 4, nullable: true),
                    Zip = table.Column<string>(maxLength: 32, nullable: true),
                    Level = table.Column<int>(nullable: false),
                    Orderlist = table.Column<int>(nullable: false),
                    IsDeleted = table.Column<bool>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_common_region", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "common_region");

            migrationBuilder.DropColumn(
                name: "SpaceValueName",
                table: "ShopProductSku");

            migrationBuilder.DropColumn(
                name: "ShopName",
                table: "shop_order_details");

            migrationBuilder.DropColumn(
                name: "SkuName",
                table: "shop_order_details");

            migrationBuilder.DropColumn(
                name: "DeliveryStatus",
                table: "shop_order");
        }
    }
}
